import React, {Component} from 'react';
import {Text,StyleSheet,Image } from 'react-native';
import {Icon,Flex} from 'antd-mobile-rn';
import AutoImage from '../components/AutoImage';

 export default class PlayImage extends Component {

    //构造函数
    constructor(props) {
        super(props);
        this.state = {
            visiable:false
        };
    }

    componentDidMount() {
    }

    //组件卸载
    componentWillUnmount() {

    }

    componentWillReceiveProps(nextProps) {
    }

    render() {
        return (
            <Flex style={{flex:1,backgroundColor:"black",position:"relative",justifyContent:"center"}}>
                        <AutoImage
                       {...this.props}
                        onLoad={()=>{
                            this.setState({visiable:true});
                        }}
                        onError={(e)=>{
                            this.setState({visiable:false});
                        }}
                        >
                           
                        </AutoImage>
                        <Image 
                                source={require('../../static/imgs/play.png')}
                                style={[{position:"absolute", bottom:"40%",left:"42%"},this.state.visiable==true?{}:{height:0}]}
                                onLoad={() => {
                                }}
                            />
                    </Flex>
        );
    }
}